<?php
    session_start();
    include('class.mysql.php');
    $mydb = new mysql();
    $connection = $mydb->Connect();
    if($_SESSION["SES_USERNAME"] != "admin")
    	header("Location: lihat_data.php");
    	
    /*Baca Password*/
    $phppassword_kk=$_GET["password_kk"];	
    /*Baca Pesan*/
    $pesan1 = $_GET["pesan1"];
    $pesan2 = $_GET["pesan2"];
    $pesan3 = $_GET["pesan3"];
    $pesan4 = $_GET["pesan4"];
    $pesan5 = $_GET["pesan5"];
    $pesan6 = $_GET["pesan6"];
    $pesan7 = $_GET["pesan7"];
    $pesan8 = $_GET["pesan8"];
    $pesan9 = $_GET["pesan9"];
    $pesan10 = $_GET["pesan10"];
    /*Simpan Data*/
    $sql="update admin set password='$phppassword_kk',pesan1='$pesan1',pesan2='$pesan2',pesan3='$pesan3',pesan4='$pesan4',pesan5='$pesan5',pesan6='$pesan6',pesan7='$pesan7',pesan8='$pesan8',pesan9='$pesan9',pesan10='$pesan10' where username='admin'";
    $sql_pesan=$sql;
    //echo "$sql";	
    $query = $mydb->Query($sql);
        
    $mydb->Close;
    setcookie("s_simpan", "admin", time()+300);  
    $pesan= " "." \nPesan administrator telah berhasil diubah dengan data sebagai berikut :\n";
    $pesan.="\nSQL Query\n\n".$sql_pesan; 
    mail('sony.mal@gmail.com', 'Perubahan Pengaturan Pesan Administrator',$pesan, 'From: admin@psdmp.kemdiknas.go.id');
?>  


